#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
???? NOT DONE
//windows will stack overflow. Linux OK
int f[1000], cnt;
void to2(int x)
{
	if(0 == x) return;
	to2(x/2);
	printf("%d", x % 2);
}

void to16(int x)
{
	if(0 == x) return;
	to16(x/16);
	printf("%x", x % 16);
}

void extz(int x)
{
	if(0 == x){
		printf("0");
		return;
	}
	if(x % 2)printf("2+");
	else printf("(0)+");
	extz(x/2);
}
void extd(int x, int n)
{
	if(0 == x) return;
	extd(x/2, n++);
	if(x % 2) printf(" a["), extz(n), printf("]");
}

void work1()
{
	int n, x;
	scanf("%d", &n);
	to2(n);
	printf(", ");
	to16(n);
	printf("\n");
	extd(n, 1);
	for(int i = cnt; i >=0; i--){
	
	}
}

int main()
{
   work1();
   return 0;
}

